home *** CD-ROM | disk | FTP | other *** search
/ The Disc - MacWorld 1995 / PowerComputing (The Disc)(MacWorld 1995).ISO / pc / cdfactor / hcfactor / hcode.exe / hcode.DXR / 00057_Start and Stop.ls < prev    next >
Encoding:
Text File  |  1995-07-14  |  11.1 KB  |  304 lines

  1. global onIBM, theQTMovie, gStartVolume, gmasterfolderpath, gDelimiter, gFileName, theBlitPict, theSparkle, objPreview, objIndexBtn, objalphabetbtn, objChapterBtn, objVolumeBtn, objCaptureGrid, objCapturePict
  2.  
  3. on startMovie
  4.   watchon()
  5.   repeat with n = 1 to 48
  6.     set the visible of sprite n to 0
  7.   end repeat
  8.   updateStage()
  9.   watchon()
  10.   openingupsetting()
  11.   watchon()
  12.   setindexprop()
  13.   initialsetting()
  14.   setMenu()
  15.   setIndexBtn()
  16.   watchon()
  17. end
  18.  
  19. on stopMovie
  20.   if objectp(theQTMovie) then
  21.     QTPause(theQTMovie)
  22.     QTDispose(theQTMovie)
  23.   end if
  24.   repeat with n = 1 to 48
  25.     set the visible of sprite n to 0
  26.     set the puppet of sprite n to 0
  27.   end repeat
  28.   updateStage()
  29.   importFileInto(cast 1, gmasterfolderpath & "GRAPHIC" & gDelimiter & "QUIT.PCT")
  30.   set the regPoint of cast 1 to point(the width of cast 1 / 2, the height of cast 1 / 2)
  31.   go("logo")
  32.   set the visible of sprite 1 to 1
  33.   updateStage()
  34.   startTimer()
  35.   repeat while the timer < 120
  36.   end repeat
  37.   killpreview()
  38.   killsparkle(theSparkle)
  39.   killCaptureGrid()
  40.   killIndexBtn()
  41.   if onIBM then
  42.     closeXLib("FILEIO.DLL")
  43.     closeXLib("BLITPICT.DLL")
  44.     closeXLib("BATQT.DLL")
  45.   end if
  46.   set gStartVolume to the soundLevel
  47.   clearGlobals()
  48. end
  49.  
  50. on startOver
  51.   repeat with n = 48 down to 1
  52.     set the visible of sprite n to 0
  53.     set the puppet of sprite n to 0
  54.   end repeat
  55.   updateStage()
  56.   killpreview()
  57.   if objectp(theQTMovie) then
  58.     QTDispose(theQTMovie)
  59.   end if
  60.   killsparkle(theSparkle)
  61.   killCaptureGrid()
  62.   killIndexBtn()
  63.   set objPreview to EMPTY
  64.   set theBlitPict to EMPTY
  65.   set theSparkle to EMPTY
  66.   set theQTMovie to EMPTY
  67.   set objIndexBtn to EMPTY
  68.   set objalphabetbtn to EMPTY
  69.   set objChapterBtn to EMPTY
  70.   set objVolumeBtn to EMPTY
  71.   set objCapturePict to EMPTY
  72.   set objCaptureGrid to EMPTY
  73.   if onIBM then
  74.     closeXLib("FILEIO.DLL")
  75.     closeXLib("BLITPICT.DLL")
  76.     closeXLib("BATQT.DLL")
  77.   end if
  78.   put "." into field 32
  79.   put "." into field 33
  80.   put "." into field 34
  81.   put "." into field 37
  82.   put "." into field 35
  83.   clearGlobals()
  84.   unLoadCast()
  85. end
  86.  
  87. on openingupsetting
  88.   global glessonlist, glessonnumber, objChapterBtn, gChapterBtnLocList, objVolumeBtn, gVolumeBtnLocList, gallchapterlist, galllessonlist, gKeywordDataList, gkeywordtext, gAlphabetExist
  89.   set the exitLock to 1
  90.   set the keyDownScript to "filterQuit"
  91.   set gStartVolume to the soundLevel
  92.   if the machineType = 256 then
  93.     set onIBM to 1
  94.     set gDelimiter to "\"
  95.     set gFileName to [:]
  96.     addProp(gFileName, #INITXT, "INI.TXT")
  97.     addProp(gFileName, #PREVIEW, "GRAPHIC\PREVIEW.BMP")
  98.     addProp(gFileName, #sparkle, "GRAPHIC\SPARKLE.BMP")
  99.     addProp(gFileName, #INDEXBTN, "GRAPHIC\INDEXBTN.BMP")
  100.     addProp(gFileName, #INTROP, "INTRO.BMP")
  101.     addProp(gFileName, #INTROM, "INTRO.MOV")
  102.     addProp(gFileName, #IFTXT, "GRAPHIC\IF.TXT")
  103.     addProp(gFileName, #Alphabet, "GRAPHIC\ALPHADN.BMP")
  104.     openXLib("FILEIO.DLL")
  105.     openXLib("BLITPICT.DLL")
  106.     openXLib("BATQT.DLL")
  107.     set objPreview to birth(script "blitPict parent for MPC")
  108.     set theBlitPict to birth(script "blitPict parent for MPC")
  109.     set theSparkle to birth(script "sparkle parent for MPC")
  110.     set theQTMovie to birth(script "batQT parent for MPC")
  111.     set objIndexBtn to birth(script "blitPict parent for MPC")
  112.     set objalphabetbtn to birth(script "blitPict parent for MPC")
  113.     set objCapturePict to birth(script "blitPict parent for MPC")
  114.     set objCaptureGrid to birth(script "blitPict parent for MPC")
  115.   else
  116.     set onIBM to 0
  117.     set gDelimiter to ":"
  118.     set gFileName to [:]
  119.     addProp(gFileName, #INITXT, "INI.TXT")
  120.     addProp(gFileName, #PREVIEW, "GRAPHIC:PREVIEW.PCT")
  121.     addProp(gFileName, #sparkle, "GRAPHIC:SPARKLE.PCT")
  122.     addProp(gFileName, #INDEXBTN, "GRAPHIC:INDEXBTN.PCT")
  123.     addProp(gFileName, #INTROP, "INTRO.PCT")
  124.     addProp(gFileName, #INTROM, "INTRO.MOV")
  125.     addProp(gFileName, #IFTXT, "GRAPHIC:IF.TXT")
  126.     addProp(gFileName, #Alphabet, "GRAPHIC:ALPHADN.PCT")
  127.     set objPreview to birth(script "blitPict parent for Mac")
  128.     set theBlitPict to birth(script "blitPict parent for Mac")
  129.     set theSparkle to birth(script "sparkle parent for Mac")
  130.     set theQTMovie to birth(script "QTMovie parent for Mac")
  131.     set objIndexBtn to birth(script "blitPict parent for Mac")
  132.     set objalphabetbtn to birth(script "blitPict parent for Mac")
  133.     set objCapturePict to birth(script "blitPict parent for Mac")
  134.     set objCaptureGrid to birth(script "blitPict parent for Mac")
  135.   end if
  136.   fileIOread(the pathName & getProp(gFileName, #INITXT))
  137.   set initxtfile to the result
  138.   if item 3 of line 1 of initxtfile = EMPTY then
  139.     set external to 0
  140.   else
  141.     set external to integer(item 3 of line 1 of initxtfile)
  142.   end if
  143.   if onIBM then
  144.     if the controlDown or (external <> 0) then
  145.       set thePath to line 2 of initxtfile
  146.       set the itemDelimiter to ":"
  147.       openXLib("LabelDrv")
  148.       set objLabelDrv to LabelDrv(mnew)
  149.       objLabelDrv(mSetRange, "A", "Z")
  150.       set driveName to objLabelDrv(mGetDrive, item 1 of thePath)
  151.       objLabelDrv(mdispose)
  152.       closeXLib("LabelDrv")
  153.       set gmasterfolderpath to char 1 of driveName & ":\"
  154.       repeat with n = 2 to the number of items in thePath - 1
  155.         put item n of thePath & "\" after gmasterfolderpath
  156.       end repeat
  157.       set the itemDelimiter to ","
  158.     else
  159.       set thePath to line 2 of initxtfile
  160.       set the itemDelimiter to ":"
  161.       set thefoldername to item the number of items in thePath - 1 of thePath
  162.       set gmasterfolderpath to the pathName & thefoldername & "\"
  163.       set the itemDelimiter to ","
  164.     end if
  165.   else
  166.     if the controlDown or (external <> 0) then
  167.       set gmasterfolderpath to line 2 of initxtfile
  168.     else
  169.       set thePath to line 2 of initxtfile
  170.       set the itemDelimiter to ":"
  171.       set thefoldername to item the number of items in thePath - 1 of thePath
  172.       set gmasterfolderpath to the pathName & thefoldername & ":"
  173.       set the itemDelimiter to ","
  174.     end if
  175.   end if
  176.   fileIOread(gmasterfolderpath & "PREP1.TXT")
  177.   set glessonlist to the result
  178.   set glessonnumber to the number of lines in glessonlist
  179.   set the text of cast 32 to glessonlist
  180.   set objGraphic to birth(script "parent <change graphic>")
  181.   importGraphic(objGraphic, external)
  182.   set objGraphic to EMPTY
  183.   set objChapterBtn to birth(script "Parent<Slider>", gChapterBtnLocList, 13)
  184.   set objVolumeBtn to birth(script "Parent<Slider>", gVolumeBtnLocList, 14)
  185.   slideListSet(objVolumeBtn, 8)
  186.   fileIOread(gmasterfolderpath & "PREP2.TXT")
  187.   set galllessonlist to getAt(value(the result), 1)
  188.   set gallchapterlist to getAt(value(the result), 2)
  189.   fileIOread(gmasterfolderpath & "PREP3.TXT")
  190.   set gkeywordtext to the result
  191.   fileIOread(gmasterfolderpath & "PREP4.TXT")
  192.   set gKeywordDataList to getAt(value(the result), 1)
  193.   set gAlphabetExist to getAt(value(the result), 2)
  194. end
  195.  
  196. on initialsetting
  197.   global gPauseMode, gcurrlessonnumber, gcurrchapternumber, gchapternumber, gstartupflag, theSparkle, gPICTQTList
  198.   set gPauseMode to 1
  199.   setpreview()
  200.   set gcurrlessonnumber to 1
  201.   set gcurrchapternumber to 1
  202.   set gchapternumber to getchapternumber(gcurrlessonnumber)
  203.   set gstartupflag to 1
  204.   loadsparkle(theSparkle)
  205.   set gPICTQTList to []
  206.   set pictscreenlist to []
  207.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
  208.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
  209.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
  210.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
  211.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
  212.   add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
  213.   add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
  214.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 2, 1, 1, 1, 1, 1, 0, 1])
  215.   add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
  216.   add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
  217.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
  218.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
  219.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
  220.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
  221.   add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
  222.   set prevclrlist to []
  223.   add(prevclrlist, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
  224.   add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
  225.   add(prevclrlist, [3, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 2, 2])
  226.   add(prevclrlist, [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
  227.   add(prevclrlist, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
  228.   add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
  229.   add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
  230.   add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
  231.   add(prevclrlist, [3, 1, 3, 2, 3, 1, 1, 1, 0, 1, 2, 0, 2, 2, 2])
  232.   add(prevclrlist, [2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
  233.   add(prevclrlist, [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
  234.   add(prevclrlist, [3, 1, 3, 2, 3, 1, 1, 1, 0, 1, 2, 0, 2, 2, 2])
  235.   add(prevclrlist, [3, 1, 1, 2, 3, 1, 1, 1, 0, 1, 2, 0, 0, 2, 2])
  236.   add(prevclrlist, [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
  237.   add(prevclrlist, [0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
  238.   set smallscreenlist to [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0]
  239.   set gPICTQTList to [pictscreenlist, prevclrlist, smallscreenlist]
  240. end
  241.  
  242. on setindexprop
  243.   global galllessonlist, gindexmaplist, pushBtn, ggridlist, gMaxKwdFld, gSelLine, glastline, gkeywordtext, gSpliteSetList
  244.   set gindexmaplist to []
  245.   repeat with n = 1 to count(galllessonlist)
  246.     set theparagraphno to getAt(getAt(galllessonlist, n), 2)
  247.     set indexMapList to []
  248.     if theparagraphno <> 0 then
  249.       setAt(indexMapList, theparagraphno, 0)
  250.     end if
  251.     add(gindexmaplist, indexMapList)
  252.   end repeat
  253.   set the text of cast 35 to the text of cast 32
  254.   set the text of cast 34 to line 1 to 24 of gkeywordtext
  255.   set indexbtnsize to 12
  256.   set maxh to 27
  257.   set maxv to 23
  258.   set originx to 151
  259.   set originy to 114
  260.   set captureArea to originx & "," & originy & "," & originx + (indexbtnsize * maxh) & "," & originy + (indexbtnsize * maxv)
  261.   set theHalf to float(indexbtnsize / 2)
  262.   set theHalfLeft to originx - theHalf
  263.   set theHalfTop to originy - theHalf
  264.   set ggridlist to [originx, originy, maxh, maxv, indexbtnsize, captureArea, theHalfLeft, theHalfTop]
  265.   set gMaxKwdFld to 24
  266.   set gSelLine to 0
  267.   set glastline to the number of lines in gkeywordtext
  268.   if glastline > gMaxKwdFld then
  269.     add(gSpliteSetList, [26, 37, 28, 29, 30, 31, 32, 33, 35, 36])
  270.     add(gSpliteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
  271.   else
  272.     add(gSpliteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
  273.     add(gSpliteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
  274.   end if
  275. end
  276.  
  277. on fileIOwrite thePath, theText
  278.   if objectp(objfileio) then
  279.     objfileio(mdispose)
  280.   end if
  281.   set objfileio to FileIO(mnew, "write", thePath)
  282.   if objectp(objfileio) then
  283.     objfileio(mWriteString, theText)
  284.     objfileio(mdispose)
  285.   else
  286.     alert(thePath && "write error")
  287.   end if
  288. end
  289.  
  290. on fileIOread thePath
  291.   if objectp(objfileio) then
  292.     objfileio(mdispose)
  293.   end if
  294.   set objfileio to FileIO(mnew, "read", thePath)
  295.   if objectp(objfileio) then
  296.     set theText to objfileio(mReadFile)
  297.     objfileio(mdispose)
  298.   else
  299.     alert(thePath && "read error")
  300.     quit()
  301.   end if
  302.   return theText
  303. end
  304.